package com.eastfair.venuebooking.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 价目表
 * </p>
 *
 * @author lyw
 * @since 2022-06-17
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("vb_price_list")
@ApiModel(value = "PriceList", description = "价目表")
@AllArgsConstructor
public class PriceList extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 价目名称
     */
    @ApiModelProperty(value = "价目名称")
    @Size(max = 20, message = "价目名称长度不能超过20")
    @TableField(value = "price_list_name", condition = LIKE)
    @Excel(name = "价目名称")
    private String priceListName;

    /**
     * 第一次生效时间
     */
    @ApiModelProperty(value = "第一次生效时间")
    @TableField(value = "valid_begin_time")
    @Excel(name = "第一次生效时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime validBeginTime;

    /**
     * 第一次失效时间
     */
    @ApiModelProperty(value = "第一次失效时间")
    @TableField(value = "valid_end_time")
    @Excel(name = "第一次失效时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime validEndTime;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注")
    private String remark;

    /**
     * 是否每年  1 是  0否      如是   需截取第一次生效时间 月日和第一次失效时间 的月日做区间比较
     */
    @ApiModelProperty(value = "是否每年  1 是  0否      如是   需截取第一次生效时间 月日和第一次失效时间 的月日做区间比较")
    @TableField(value = "is_every_year")
    @Excel(name = "是否每年  1 是  0否      如是   需截取第一次生效时间 月日和第一次失效时间 的月日做区间比较", replace = {"是_true", "否_false", "_null"})
    private Boolean isEveryYear;

    /**
     * 场地名称"/"隔开
     */
    @ApiModelProperty(value = "场地名称\"\"隔开")
    @Size(max = 500, message = "场地名称\"\"隔开长度不能超过500")
    @TableField(value = "space_names", condition = LIKE)
    @Excel(name = "场地名称\"\"隔开")
    private String spaceNames;

    /**
     * 计价单位编码
     */
    @ApiModelProperty(value = "计价单位编码")
    @Size(max = 255, message = "计价单位编码长度不能超过255")
    @TableField(value = "unit_code", condition = LIKE)
    @Excel(name = "计价单位编码")
    private String unitCode;


    @Builder
    public PriceList(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    String priceListName, LocalDateTime validBeginTime, LocalDateTime validEndTime, String remark, Boolean isEveryYear, String spaceNames, String unitCode) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.priceListName = priceListName;
        this.validBeginTime = validBeginTime;
        this.validEndTime = validEndTime;
        this.remark = remark;
        this.isEveryYear = isEveryYear;
        this.spaceNames = spaceNames;
        this.unitCode = unitCode;
    }

}
